package cc.rboot.inject.template;

import cc.rboot.inject.core.AbstractMapperInjector;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;

@RestController
@RequestMapping(path = "/_inject")
public class InjectDelete<T> extends AbstractMapperInjector<T> {

    /**
     * 默认的删除接口
     *
     * @param id
     */
    @DeleteMapping(path = "/{id}")
    public void _execute(@PathVariable(value = "id", required = true) Serializable id) throws Exception {
        super.getService().removeById(id);
    }
}
